<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8">
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="${path }/static/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <script type="text/javascript">
    	var msg='${msg}';
    	if(msg==null||msg==""){
    		
    	}else{
    		alert(msg);
    	}
    </script>
  </head>
  <body>
    <div class="container-fluid">
	<div class="row-fluid">
		<div class="span12">
			<form class="form-search" action="${path }/toselect" >
				<input class="input-medium search-query" name="name" type="text" /> <button type="submit" class="btn">查找</button>
				<button><a href="${path }/text">退出</a></button>
			</form>
			<table class="table">
				<thead>
					<tr>
						<th>
							编号
						</th>
						<th>
							家庭名称
						</th>
						<th>
							操作
						</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${list }" var="f" varStatus="status">
						<tr>
							<td>${status.count}</td>
							<td>${f.name }</td>
							<td><a href="${path }/delete?id=${f.id }">删除</a></td>
							<td><a href="${path }/toupdate?id=${f.id }">修改</a></td>

							
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<form action="${path }/toadd">
			 	<a href="${path }/toadd?id=${f.id}" class="btn btn-info btn-large" type="button">添加家庭</a>
			 </form>
			
		</div>
	</div>
</div>
 
    <script src="${path }/static/css/js/jquery.min.js"></script>
    <script src="${path }/static/css/js/bootstrap.min.js"></script>
  </body>
</html>